package com.cxd.service.impl;
import com.cxd.entity.EbUser;
import com.cxd.mapper.EbUserMapper;
import com.cxd.service.IEbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class EbUserServiceImpl implements IEbUserService {
    @Autowired
    private EbUserMapper ebUserMapper;
    @Override
    public List<EbUser> listByPage(Integer page, Integer pageSize){
        Integer from = (page - 1)*pageSize;
        return ebUserMapper.listByPage(from,pageSize);
    }
    @Override
    public EbUser selectByCondition(String  euUserId){
        return ebUserMapper.selectByCondition(euUserId);
    };
    @Override
    public int updateByPrimaryKey(EbUser ebUser){
        return ebUserMapper.updateByPrimaryKey(ebUser);
    };
    @Override
    public int delete(String euUserId){
        return ebUserMapper.delete(euUserId);
    };
    @Override
    public Integer findTotalPage(Integer pageSize) {
        return ebUserMapper.getTotalPage(pageSize);
    }
    @Override
    public  Integer save(EbUser ebUser){
        return ebUserMapper.save(ebUser);
    }

    @Override
    public EbUser login(String euUserId, String euPassword) {
        return ebUserMapper.findUserByUserNameAndPassword(euUserId,euPassword);
    }

}
